//
//  DMMessageBaseModel.m
//  HDMainWindow
//
//  Created by apple on 2017/5/5.
//  Copyright © 2017年 com.devin.definesys. All rights reserved.
//

#import "DMMessageBaseModel.h"

@implementation DMMessageBaseModel

#pragma mark - MessageCell更新 -
- (void)setNeedsUpdateForReuse {
    _updateType |= kLLMessageCellUpdateTypeNewForReuse;
    _updateType |= (kLLMessageCellUpdateTypeNewForReuse - 1);
}

- (BOOL)checkNeedsUpdateForReuse {
    return (_updateType & kLLMessageCellUpdateTypeNewForReuse) > 0;
}

- (BOOL)checkNeedsUpdate {
    return _updateType != kLLMessageCellUpdateTypeNone;
}

- (void)clearNeedsUpdateForReuse {
    _updateType = kLLMessageCellUpdateTypeNone;
}

- (void)setNeedsUpdateThumbnail {
    _updateType |= kLLMessageCellUpdateTypeThumbnailChanged;
}

- (void)setNeedsUpdateUploadStatus {
    _updateType |= kLLMessageCellUpdateTypeUploadStatusChanged;
}

- (void)setNeedsUpdateDownloadStatus {
    _updateType |= kLLMessageCellUpdateTypeDownloadStatusChanged;
}

- (BOOL)checkNeedsUpdateThumbnail {
    return (_updateType & kLLMessageCellUpdateTypeThumbnailChanged) > 0;
}

- (BOOL)checkNeedsUpdateUploadStatus {
    return (_updateType & kLLMessageCellUpdateTypeUploadStatusChanged) > 0;
}

- (BOOL)checkNeedsUpdateDownloadStatus {
    return (_updateType & kLLMessageCellUpdateTypeDownloadStatusChanged) > 0;
}

- (void)clearNeedsUpdateThumbnail {
    _updateType &= ~kLLMessageCellUpdateTypeThumbnailChanged;
}

- (void)clearNeedsUpdateUploadStatus {
    _updateType &= ~kLLMessageCellUpdateTypeUploadStatusChanged;
}

- (void)clearNeedsUpdateDownloadStatus {
    _updateType &= ~kLLMessageCellUpdateTypeDownloadStatusChanged;
}



@end
